#pragma once

#ifndef LHJ_CORE_DATA_CONFIGVALUE_H__
#define LHJ_CORE_DATA_CONFIGVALUE_H__

#include <string>

namespace cores
{
    namespace datas
    {
        namespace configures
        {
            using namespace std;

            class Value
            {
            public:
                Value();
                virtual ~Value();

                virtual string toString() const;
                virtual int toInt() const;
                virtual double toDouble() const;
                virtual bool toBool() const;
            };

            class IntValue : public Value
            {
            public:
                IntValue(const int &value);
                virtual ~IntValue();

            protected:
                virtual int toInt() const override;
                virtual string toString() const override;

            private:
                int _value{0};
            };

            class StringValue : public Value
            {
            public:
                StringValue(const string &value);
                virtual ~StringValue();

            protected:
                virtual string toString() const override;

            private:
                string _value;
            };

            class DoubleValue : public Value
            {
            public:
                DoubleValue(const double &value);
                virtual ~DoubleValue();

            protected:
                virtual double toDouble() const override;
                virtual string toString() const override;

            private:
                double _value;
            };

            class BoolValue : public Value
            {
            public:
                BoolValue(const bool &value);
                virtual ~BoolValue();

            protected:
                virtual bool toBool() const override;
                virtual string toString() const override;

            private:
                bool _value;
            };
        }
    }
}

#endif